﻿using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Kaskelot.SP.Services;
using Stockholm.SOA.Kaskelot.WCF.DataContracts;
using Kaskelot.SP.Core;
using Kaskelot.SP.Model.Contracts;

namespace Kaskelot.SP.UI.CONTROLTEMPLATES.Kaskelot.SP.UI.Forms
{
	public partial class ByggnadTypForm : BaseForm, IForm
	{
		public string Id { get; set; }
		public string ParentId { get; set; }
		public ByggnadTyp Current { get; set; }

		protected void Page_Load(object sender, EventArgs e)
		{
			if (Page.IsPostBack)
				return;

			using (AdminService svc = new AdminService())
			{
				if (Id.IsGuid())
					Current = svc.GetByggnadTyp(new Guid(Id));
			}

			if (Current == null)
			{
				Current = new ByggnadTyp();
			}
		}
	}
}
